package com.ftg.learn;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author kangjx
 * @createTime 2022/9/9
 */
@SpringBootApplication
public class NacosApp {

    public static void main(String[] args) {
        /**
         * 应用程序上下文配置
         */
//        ConfigurableApplicationContext applicationContext = SpringApplication.run(NacosApp.class, args);
//        //通过应用程序上下文来拿取变量
//        String userName = applicationContext.getEnvironment().getProperty("user.name");
//        String userAge = applicationContext.getEnvironment().getProperty("user.age");
//        System.err.println("user name :" +userName+"; age: "+userAge);
        SpringApplication.run(NacosApp.class,args);
    }

}
